﻿using MediatR;
using T.Settlement.API.Application.Command.PaymentCommand;
using T.Settlement.Repository.SettlementInterface;

namespace T.Settlement.API.Application.CommandHandlers.PaymentHandler
{
    public class PaymentCreateCommandHandler : IRequestHandler<PaymentCreateCommand, int>
    {
        private readonly IPaymentSRepository _paymentSRepository;
        public PaymentCreateCommandHandler(IPaymentSRepository paymentSRepository)
        {
            _paymentSRepository = paymentSRepository;
        }
        public async Task<int> Handle(PaymentCreateCommand request, CancellationToken cancellationToken)
        {
            return await _paymentSRepository.AddAsync(request);
        }
    }
}
